package com.jlboot.core.Interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jlboot.core.util.LoginUtil;
import com.jlboot.model.po.sys.SysOnline;

/**
 * @author wangsanfei
 * @version 1.0
 * Create by 2024/5/19 08:50
 */
public class GlobalInterceptor implements Interceptor {
    @Override
    public void intercept(Invocation inv) {

        //更新在线时间
        if(LoginUtil.isLogin()){
            SysOnline.dao.saveActive(LoginUtil.getTokenSessId());
        }

        inv.invoke();

    }
}
